<?php

$name = $_POST['name'];
$soundURL = $_POST['soundURL'];
$imageURL = $_POST['imageURL'];
$year = $_POST['year'];
$month = $_POST['month'];
$age = $_POST['age'];
$ImageAid1URL = $_POST['ImageAid1URL'];
$ImageAid2URL = $_POST['ImageAid2URL'];

if (isset($name)) {
    $name = trim($name);
}

if (isset($soundURL)) {
    $soundURL = trim($soundURL);
}

$sql = "SELECT * FROM t_admin WHERE username = '" . $username . "' AND password = '" . $password . "'";
$db = new DBC();
$data = $db->fetchData($sql);
if (count($data) > 0) {
    $_SESSION['username'] = $username;
    header("packList.php");
    //确保重定向后，后续代码不会被执行
    exit;
}

function checkTrim($item){
    if(isset($item)){
        $item = trim($item);
    }
    return $item;
}
?>
